package com.example.nio.charbuffer;

import java.nio.CharBuffer;

/**
 * @author panghu
 * @version 1.0.0
 * @createTime 2023年08月06日 13:22:00
 * @Description
 */
public class CharBufferDemo {

    public static void main(String[] args) {
        CharBuffer buffer = CharBuffer.wrap("lbwnb");
        while (buffer.hasRemaining()){
            System.out.print(buffer.get());
        }
        buffer.flip();
        // 底层是直接保存字符串，字符串是不能修改的
        buffer.put(0,'a');
    }

}
